import { httpInstance } from '@/utils/request'

interface UpdateProfileAPIData {
  avatar?: string
  nickname?: string
}

export function updateProfileAPI(
  data: UpdateProfileAPIData,
  token: string,
) {
  return httpInstance.post<
    Record<string, any>,
    UpdateProfileAPIData
  >(
    'api/user/profile',
    data,
    { headers: { token } },
  )
}
